class AddRaceToPatientsTable < ActiveRecord::Migration
  def self.up
    add_column :patients, :race_id, :integer, :null => false
    
    race = Race.find(:first)
    Patient.find(:all).each do |patient|
      patient.race = race
      patient.save
    end
    add_index :patients, :race_id
  end

  def self.down
    remove_index :patients, :race_id
    remove_column :patients, :race_id
  end
end
